Every application running in a JVM requires operating memory to run. The amount of the required operating memory depends in part on the type of task the application was created for. An aspect of the JAVA programming language is that the required operating memory needs to be estimated and allocated prior to the execution of the application itself. However, the exact operating memory requirements for every application running on a JVM cannot always be accurately estimated since the execution of the application tends to be non-deterministic, e.g., external applications may be involved during the execution of the application which may affect the amount of required operating memory for the application to run.
Presently, when an application is running in a JVM, a user is typically able to monitor the state of the application. If the application consumes more operating memory than the user expected before starting the application, the user may determine to abort the execution of the application. If the user does not abort the execution of the application, the application may automatically abort with an error message. Either way, the user can then allocate more operating memory to the JVM to run the application and then restart the application. Restarting the application is time-consuming and leads to the unavailability of the application to the users. In addition, if the application consumes less operating memory than what was estimated and allocated before starting the application, the operating system is deprived of operating memory resources that may have been better utilized elsewhere.